py_list=['aa','bb','cc']
print(py_list)
print(py_list[1])
print(py_list[-1]) #返回列表最后一个元素

#元素的删除  del pop remove
motocycles=['dazhong','baoma','benci','bentian','yamaha']

print(motocycles)
del motocycles[1]
print(motocycles)

pop_motocycles=motocycles.pop()
print(motocycles)
print(pop_motocycles)

remove_motocycles='benci'
motocycles.remove(remove_motocycles)
print(motocycles)
print(remove_motocycles)

#元素的新增  append insert
motocycles.append('biyadi')
print(motocycles)

motocycles.insert(1,'xuefulai')
print(motocycles)

#元素的修改
motocycles[0]='fentian'
print(motocycles)

#列表的排序

#1、永久性排序
cars=['bmw','audi','toyota','subaru']
print(cars)
cars.sort()
print(cars)
cars.sort(reverse=True)
print(cars)

#2、临时排序 sorte()

print(sorted(cars))
print(cars)

#3、反转reverse()
reverse_list=['a','b','dd']
reverse_list.reverse()
print(reverse_list)

#列表的长度
print(len(cars),len(reverse_list))

